<template>
        <rx-layout>
            <div slot="center">
                <a-form-model ref="form"  :model="mdl"  :label-col="labelCol" :wrapper-col="wrapperCol">
                                <a-form-model-item  :label="i18n('form.appName','应用名称')" prop = "appId">
                                    <span>
                                        {{ allApps[mdl.appId] ? $i18(allApps[mdl.appId].appName, '应用名称') : $ti18('rxList.noAppName', '无') }}
                                    </span>
                                </a-form-model-item>
                                <a-form-model-item  :label="i18n('form.createUserName','转换人')" prop = "createUserName">
                                        <a-input :disabled="readOnly" :placeholder="i18n('form.createUserName','请输入转换人','input')" v-model="mdl.createUserName"/>
                                </a-form-model-item>
                                <a-form-model-item  :label="i18n('form.errorMessage','出错信息')" prop = "errorMessage">
                                        <a-textarea :disabled="readOnly" v-model="mdl.errorMessage"/>
                                </a-form-model-item>
                                <a-form-model-item  :label="i18n('form.name','转换名称')" prop = "name">
                                    <a-input :disabled="readOnly" :placeholder="i18n('form.name','请输入转换名称','input')" v-model="mdl.name"/>
                                </a-form-model-item>
                                <a-form-model-item  :label="i18n('form.status','状态')" prop = "status">
                                    {{statusMap[mdl.status].text}}
                                </a-form-model-item>
                </a-form-model>
            </div>
        </rx-layout>
</template>
<script>
    import FormTransLogApi from '@/api/form/core/formTransLog'
    import {RxDialog,BaseFormModel} from "@lowcode/jpaas-common-lib";
    import {mapState} from 'vuex';

    export default {
        name: 'FormTransLogEdit',
        mixins:[BaseFormModel],
        computed: {
            ...mapState({
                // 所属应用
                allApps: state => state.appSetting ? state.appSetting.allApps : {}
            }),
        },
        props:{
            readOnly:{
                type: Boolean,
                default: true
            }
        },
        components: {
            RxDialog,
        },
        data(){
            return {
                /**
                 * 子表列表，以及表格属性
                 */
                subTable:{},
                statusMap: {
                    1: { color: 'green', text: this.i18n('list.success','成功') },
                    0: { color: 'red', text: this.i18n('list.fail','失败') },
                },
        }

        },
        methods: {
            i18n(name,text,key){
                return this.$ti18(name,text,"formTransLog",key);
            },
            get(id){
                return FormTransLogApi.get(id);
            },

            save(){
                return FormTransLogApi.save(this.mdl);
            },

        }
    }
</script>
<style>
    .relick a{
        margin-right: 10px;
    }

</style>
